package ioc02.view;

import ioc02.controller.UserController;
import ioc02.entity.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Author：汤小洋
 * Date：2023-12-13 11:20
 * Description：<描述>
 */
public class UserView {
    public static void main(String[] args) {
        String username = "admin";
        String password = "123";

        ApplicationContext ac = new ClassPathXmlApplicationContext("ioc02/spring.xml");
        UserController userController = (UserController) ac.getBean("userController");
        User user = userController.login(username, password);

        if (user==null){
            System.out.println("登录失败");
        }else{
            System.out.println("登录成功");
        }

    }
}
